<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>机构管理</title>
<!--                       CSS                       --
<!-- Reset Stylesheet -->
<link rel="stylesheet" href="/oa/css/reset.css" type="text/css"
	media="screen" />
<!-- Main Stylesheet -->
<link rel="stylesheet" href="/oa/css/styleMain.css" type="text/css"
	media="screen" />
<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
<link rel="stylesheet" href="/oa/css/invalid.css" type="text/css"
	media="screen" />
<link href="/oa/css/style.css" rel="stylesheet" type="text/css">
<!--                       Javascripts                       -->
<script type="text/javascript" src="/oa/js/datePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/oa/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="/oa/js/myDate.js"></script>
<script type="text/javascript">
	function topage(page) {
		var form = document.forms[0];
		form.currentpage.value = page;
		form.submit();
	}
	$(document)
			.ready(
					function(e) {
						$("#checkAll").click(
								function() {
									$("body :checkbox").attr("checked",
											$("#checkAll").attr("checked"));
								});
						$("#btnDel")
								.click(
										function() {
											var form = document.forms[0];
											form.action = '<s:url namespace="/page/permanage" action="deleteBranch" />';
											form.submit();
										});

					});
	$("#search")
			.click(
					function() {
						if ($("#parameters").val() == "") {
							alert("请输入搜索机构");
							return false;
						} else {
							var form = document.forms[0];
							form.action = '<s:url namespace="/page/permanage" action="listBranch" />';
							form.submit();
						}
					});
	function findByInfo() {
		if ($("#info").val() != "") {
			$("#parameters").show();
			$("#search").show();
		}
	}
</script>

</head>
<body>
	<div>
		<!-- Wrapper for the radial gradient background -->
		<div>
			<!-- Main Content Section with everything -->
			<div class="clear"></div>
			<!-- End .clear -->
			<div class="content-box">
				<!-- Start Content Box -->
				<s:form namespace="/page/permanage/" action="listLBranch"
					id="loginLogForm">
					<s:hidden name="currentpage"></s:hidden>
					<div class="content-box-header">
						<h3>机构管理</h3>
						<s:fielderror></s:fielderror>
						<ul class="content-box-tabs">
							<li><a href="#tab1" class="default-tab">浏览</a>
							</li>
							<!-- href must be unique and match the id of target div -->
							<li><a href="/oa/page/permanage/addBranch.jsp">新增</a>
							</li>
						</ul>
						<div class="clear"></div>
					</div>
					<!-- End .content-box-header -->
					<div class="content-box-content">
						<div class="tab-content default-tab" id="tab1">
							<!--搜索框-->
							<div class="searchPanel">
								<br />
								<table>
									<tr>
										<td colspan="5"><label>
												<div align="left">请选择搜索类别：
										</label> <select name="info" id="info" onchange="findByInfo()">
												<option selected="selected">请选择</option>
												<option value="name">机构总称</option>
												<option value="shotName">机构简称</option>
										</select> &nbsp;&nbsp; <input id="parameters" type="text"
											style="display:none" /> &nbsp; <input id="search"
											class="button" type="submit" value="搜一下" style="display:none" />
											</div></td>
									</tr>
									<tr>
										<th><input class="check-all" type="checkbox"
											id="checkAll" />全选&nbsp;&nbsp;<input type="button"
											class="button" value="批量删除" id="btnDel" />
										</th>
										<th>机构编号</th>
										<th>机构名称</th>
										<th>机构简称</th>
										<th>操作</th>
									</tr>
									<s:iterator value="pageView.records" status="entry">
										<tr>
											<td><input type="checkbox" class="check-all" name="delId"
												value="${id}" />
											</td>
											<td>${id}</td>
											<td>${name}</td>
											<td>${shotName}</td>
											<td><img
												onclick="location.href='<s:url action="showBranch" namespace="/page/permanage"><s:param name="branch.id" value="branchId"/></s:url>'"
												title="编辑" src="/oa/images/bt_edit.gif" alt="Edit" />
												&nbsp;&nbsp;&nbsp; <img
												onclick="deleteBranch('${id}','${name}')" title="删除"
												src="/oa/images/bt_del.gif" class="op_button" /></td>
										</tr>
									</s:iterator>
									<tr>
										<th colspan="5" class="pager">
											<div class="pager">
												<s:include value="/page/share/paging.jsp"></s:include>
											</div>
											<div class="clear"></div></th>
									</tr>
								</table>
							</div>
						</div>
						<!-- End #tab1 -->

					</div>
					<!-- End .content-box-content -->
				</s:form>
			</div>
		</div>
		<!-- End #main-content -->
	</div>
</body>
</html>
